3.87 \(\int \frac{\log (e (\frac{a+b x}{c+d x})^n)}{x^2 (f+g x+h x^2)} \, dx\)

Optimal. Leaf size=995 \[ \text{result too large to display} \]

[Out]

(b*n*Log[x])/(a*f) - (d*n*Log[x])/(c*f) - (b*n*Log[a + b*x])/(a*f) - (n*Log[a + b*x])/(f*x) - (g*n*Log[-((b*x)
/a)]*Log[a + b*x])/f^2 + (d*n*Log[c + d*x])/(c*f) + (n*Log[c + d*x])/(f*x) + (g*n*Log[-((d*x)/c)]*Log[c + d*x]
)/f^2 + (n*Log[a + b*x] - Log[e*((a + b*x)/(c + d*x))^n] - n*Log[c + d*x])/(f*x) + ((g^2 - 2*f*h)*ArcTanh[(g +
 2*h*x)/Sqrt[g^2 - 4*f*h]]*(n*Log[a + b*x] - Log[e*((a + b*x)/(c + d*x))^n] - n*Log[c + d*x]))/(f^2*Sqrt[g^2 -
 4*f*h]) + (g*Log[x]*(n*Log[a + b*x] - Log[e*((a + b*x)/(c + d*x))^n] - n*Log[c + d*x]))/f^2 + ((g + (g^2 - 2*
f*h)/Sqrt[g^2 - 4*f*h])*n*Log[a + b*x]*Log[-((b*(g - Sqrt[g^2 - 4*f*h] + 2*h*x))/(2*a*h - b*(g - Sqrt[g^2 - 4*
f*h])))])/(2*f^2) - ((g + (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*Log[c + d*x]*Log[-((d*(g - Sqrt[g^2 - 4*f*h] + 2*
h*x))/(2*c*h - d*(g - Sqrt[g^2 - 4*f*h])))])/(2*f^2) + ((g - (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*Log[a + b*x]*L
og[-((b*(g + Sqrt[g^2 - 4*f*h] + 2*h*x))/(2*a*h - b*(g + Sqrt[g^2 - 4*f*h])))])/(2*f^2) - ((g - (g^2 - 2*f*h)/
Sqrt[g^2 - 4*f*h])*n*Log[c + d*x]*Log[-((d*(g + Sqrt[g^2 - 4*f*h] + 2*h*x))/(2*c*h - d*(g + Sqrt[g^2 - 4*f*h])
))])/(2*f^2) - (g*(n*Log[a + b*x] - Log[e*((a + b*x)/(c + d*x))^n] - n*Log[c + d*x])*Log[f + g*x + h*x^2])/(2*
f^2) + ((g + (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*PolyLog[2, (2*h*(a + b*x))/(2*a*h - b*(g - Sqrt[g^2 - 4*f*h]))
])/(2*f^2) + ((g - (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*PolyLog[2, (2*h*(a + b*x))/(2*a*h - b*(g + Sqrt[g^2 - 4*
f*h]))])/(2*f^2) - (g*n*PolyLog[2, 1 + (b*x)/a])/f^2 - ((g + (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*PolyLog[2, (2*
h*(c + d*x))/(2*c*h - d*(g - Sqrt[g^2 - 4*f*h]))])/(2*f^2) - ((g - (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*PolyLog[
2, (2*h*(c + d*x))/(2*c*h - d*(g + Sqrt[g^2 - 4*f*h]))])/(2*f^2) + (g*n*PolyLog[2, 1 + (d*x)/c])/f^2

________________________________________________________________________________________

Rubi [A]  time = 1.29131, antiderivative size = 995, normalized size of antiderivative = 1., number of steps used = 40, number of rules used = 16, integrand size = 34, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.471, Rules used = {2513, 2418, 2395, 36, 29, 31, 2394, 2315, 2393, 2391, 709, 800, 634, 618, 206, 628} \[ \frac{b n \log (x)}{a f}-\frac{d n \log (x)}{c f}+\frac{g \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \log (x)}{f^2}-\frac{b n \log (a+b x)}{a f}-\frac{g n \log \left (-\frac{b x}{a}\right ) \log (a+b x)}{f^2}-\frac{n \log (a+b x)}{f x}+\frac{d n \log (c+d x)}{c f}+\frac{g n \log \left (-\frac{d x}{c}\right ) \log (c+d x)}{f^2}+\frac{n \log (c+d x)}{f x}+\frac{\left (g^2-2 f h\right ) \tanh ^{-1}\left (\frac{g+2 h x}{\sqrt{g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{f^2 \sqrt{g^2-4 f h}}+\frac{n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)}{f x}+\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (a+b x) \log \left (-\frac{b \left (g+2 h x-\sqrt{g^2-4 f h}\right )}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}-\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (c+d x) \log \left (-\frac{d \left (g+2 h x-\sqrt{g^2-4 f h}\right )}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}+\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (a+b x) \log \left (-\frac{b \left (g+2 h x+\sqrt{g^2-4 f h}\right )}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}-\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (c+d x) \log \left (-\frac{d \left (g+2 h x+\sqrt{g^2-4 f h}\right )}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}-\frac{g \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \log \left (h x^2+g x+f\right )}{2 f^2}+\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{PolyLog}\left (2,\frac{2 h (a+b x)}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}+\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{PolyLog}\left (2,\frac{2 h (a+b x)}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}-\frac{g n \text{PolyLog}\left (2,\frac{b x}{a}+1\right )}{f^2}-\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{PolyLog}\left (2,\frac{2 h (c+d x)}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}-\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{PolyLog}\left (2,\frac{2 h (c+d x)}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}+\frac{g n \text{PolyLog}\left (2,\frac{d x}{c}+1\right )}{f^2} \]

Antiderivative was successfully verified.

[In]

Int[Log[e*((a + b*x)/(c + d*x))^n]/(x^2*(f + g*x + h*x^2)),x]

[Out]

(b*n*Log[x])/(a*f) - (d*n*Log[x])/(c*f) - (b*n*Log[a + b*x])/(a*f) - (n*Log[a + b*x])/(f*x) - (g*n*Log[-((b*x)
/a)]*Log[a + b*x])/f^2 + (d*n*Log[c + d*x])/(c*f) + (n*Log[c + d*x])/(f*x) + (g*n*Log[-((d*x)/c)]*Log[c + d*x]
)/f^2 + (n*Log[a + b*x] - Log[e*((a + b*x)/(c + d*x))^n] - n*Log[c + d*x])/(f*x) + ((g^2 - 2*f*h)*ArcTanh[(g +
 2*h*x)/Sqrt[g^2 - 4*f*h]]*(n*Log[a + b*x] - Log[e*((a + b*x)/(c + d*x))^n] - n*Log[c + d*x]))/(f^2*Sqrt[g^2 -
 4*f*h]) + (g*Log[x]*(n*Log[a + b*x] - Log[e*((a + b*x)/(c + d*x))^n] - n*Log[c + d*x]))/f^2 + ((g + (g^2 - 2*
f*h)/Sqrt[g^2 - 4*f*h])*n*Log[a + b*x]*Log[-((b*(g - Sqrt[g^2 - 4*f*h] + 2*h*x))/(2*a*h - b*(g - Sqrt[g^2 - 4*
f*h])))])/(2*f^2) - ((g + (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*Log[c + d*x]*Log[-((d*(g - Sqrt[g^2 - 4*f*h] + 2*
h*x))/(2*c*h - d*(g - Sqrt[g^2 - 4*f*h])))])/(2*f^2) + ((g - (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*Log[a + b*x]*L
og[-((b*(g + Sqrt[g^2 - 4*f*h] + 2*h*x))/(2*a*h - b*(g + Sqrt[g^2 - 4*f*h])))])/(2*f^2) - ((g - (g^2 - 2*f*h)/
Sqrt[g^2 - 4*f*h])*n*Log[c + d*x]*Log[-((d*(g + Sqrt[g^2 - 4*f*h] + 2*h*x))/(2*c*h - d*(g + Sqrt[g^2 - 4*f*h])
))])/(2*f^2) - (g*(n*Log[a + b*x] - Log[e*((a + b*x)/(c + d*x))^n] - n*Log[c + d*x])*Log[f + g*x + h*x^2])/(2*
f^2) + ((g + (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*PolyLog[2, (2*h*(a + b*x))/(2*a*h - b*(g - Sqrt[g^2 - 4*f*h]))
])/(2*f^2) + ((g - (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*PolyLog[2, (2*h*(a + b*x))/(2*a*h - b*(g + Sqrt[g^2 - 4*
f*h]))])/(2*f^2) - (g*n*PolyLog[2, 1 + (b*x)/a])/f^2 - ((g + (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*PolyLog[2, (2*
h*(c + d*x))/(2*c*h - d*(g - Sqrt[g^2 - 4*f*h]))])/(2*f^2) - ((g - (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*n*PolyLog[
2, (2*h*(c + d*x))/(2*c*h - d*(g + Sqrt[g^2 - 4*f*h]))])/(2*f^2) + (g*n*PolyLog[2, 1 + (d*x)/c])/f^2

Rule 2513

Int[Log[(e_.)*((f_.)*((a_.) + (b_.)*(x_))^(p_.)*((c_.) + (d_.)*(x_))^(q_.))^(r_.)]*(RFx_.), x_Symbol] :> Dist[
p*r, Int[RFx*Log[a + b*x], x], x] + (Dist[q*r, Int[RFx*Log[c + d*x], x], x] - Dist[p*r*Log[a + b*x] + q*r*Log[
c + d*x] - Log[e*(f*(a + b*x)^p*(c + d*x)^q)^r], Int[RFx, x], x]) /; FreeQ[{a, b, c, d, e, f, p, q, r}, x] &&
RationalFunctionQ[RFx, x] && NeQ[b*c - a*d, 0] &&  !MatchQ[RFx, (u_.)*(a + b*x)^(m_.)*(c + d*x)^(n_.) /; Integ
ersQ[m, n]]

Rule 2418

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{u = ExpandIntegrand[
(a + b*Log[c*(d + e*x)^n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d, e, n}, x] && RationalFunct
ionQ[RFx, x] && IntegerQ[p]

Rule 2395

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[((f + g
*x)^(q + 1)*(a + b*Log[c*(d + e*x)^n]))/(g*(q + 1)), x] - Dist[(b*e*n)/(g*(q + 1)), Int[(f + g*x)^(q + 1)/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 2394

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))/((f_.) + (g_.)*(x_)), x_Symbol] :> Simp[(Log[(e*(f +
g*x))/(e*f - d*g)]*(a + b*Log[c*(d + e*x)^n]))/g, x] - Dist[(b*e*n)/g, Int[Log[(e*(f + g*x))/(e*f - d*g)]/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n}, x] && NeQ[e*f - d*g, 0]

Rule 2315

Int[Log[(c_.)*(x_)]/((d_) + (e_.)*(x_)), x_Symbol] :> -Simp[PolyLog[2, 1 - c*x]/e, x] /; FreeQ[{c, d, e}, x] &
& EqQ[e + c*d, 0]

Rule 2393

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))]*(b_.))/((f_.) + (g_.)*(x_)), x_Symbol] :> Dist[1/g, Subst[Int[(a +
 b*Log[1 + (c*e*x)/g])/x, x], x, f + g*x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] && EqQ[g
 + c*(e*f - d*g), 0]

Rule 2391

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> -Simp[PolyLog[2, -(c*e*x^n)]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 709

Int[((d_.) + (e_.)*(x_))^(m_)/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(e*(d + e*x)^(m + 1))/((m
 + 1)*(c*d^2 - b*d*e + a*e^2)), x] + Dist[1/(c*d^2 - b*d*e + a*e^2), Int[((d + e*x)^(m + 1)*Simp[c*d - b*e - c
*e*x, x])/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*
e + a*e^2, 0] && NeQ[2*c*d - b*e, 0] && LtQ[m, -1]

Rule 800

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Int[Exp
andIntegrand[((d + e*x)^m*(f + g*x))/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[b^2 -
 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[m]

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rubi steps

\begin{align*} \int \frac{\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )}{x^2 \left (f+g x+h x^2\right )} \, dx &=n \int \frac{\log (a+b x)}{x^2 \left (f+g x+h x^2\right )} \, dx-n \int \frac{\log (c+d x)}{x^2 \left (f+g x+h x^2\right )} \, dx-\left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \int \frac{1}{x^2 \left (f+g x+h x^2\right )} \, dx\\ &=\frac{n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)}{f x}+n \int \left (\frac{\log (a+b x)}{f x^2}-\frac{g \log (a+b x)}{f^2 x}+\frac{\left (g^2-f h+g h x\right ) \log (a+b x)}{f^2 \left (f+g x+h x^2\right )}\right ) \, dx-n \int \left (\frac{\log (c+d x)}{f x^2}-\frac{g \log (c+d x)}{f^2 x}+\frac{\left (g^2-f h+g h x\right ) \log (c+d x)}{f^2 \left (f+g x+h x^2\right )}\right ) \, dx-\frac{\left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \int \frac{-g-h x}{x \left (f+g x+h x^2\right )} \, dx}{f}\\ &=\frac{n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)}{f x}+\frac{n \int \frac{\left (g^2-f h+g h x\right ) \log (a+b x)}{f+g x+h x^2} \, dx}{f^2}-\frac{n \int \frac{\left (g^2-f h+g h x\right ) \log (c+d x)}{f+g x+h x^2} \, dx}{f^2}+\frac{n \int \frac{\log (a+b x)}{x^2} \, dx}{f}-\frac{n \int \frac{\log (c+d x)}{x^2} \, dx}{f}-\frac{(g n) \int \frac{\log (a+b x)}{x} \, dx}{f^2}+\frac{(g n) \int \frac{\log (c+d x)}{x} \, dx}{f^2}-\frac{\left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \int \left (-\frac{g}{f x}+\frac{g^2-f h+g h x}{f \left (f+g x+h x^2\right )}\right ) \, dx}{f}\\ &=-\frac{n \log (a+b x)}{f x}-\frac{g n \log \left (-\frac{b x}{a}\right ) \log (a+b x)}{f^2}+\frac{n \log (c+d x)}{f x}+\frac{g n \log \left (-\frac{d x}{c}\right ) \log (c+d x)}{f^2}+\frac{n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)}{f x}+\frac{g \log (x) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{f^2}+\frac{n \int \left (\frac{\left (g h+\frac{h \left (g^2-2 f h\right )}{\sqrt{g^2-4 f h}}\right ) \log (a+b x)}{g-\sqrt{g^2-4 f h}+2 h x}+\frac{\left (g h-\frac{h \left (g^2-2 f h\right )}{\sqrt{g^2-4 f h}}\right ) \log (a+b x)}{g+\sqrt{g^2-4 f h}+2 h x}\right ) \, dx}{f^2}-\frac{n \int \left (\frac{\left (g h+\frac{h \left (g^2-2 f h\right )}{\sqrt{g^2-4 f h}}\right ) \log (c+d x)}{g-\sqrt{g^2-4 f h}+2 h x}+\frac{\left (g h-\frac{h \left (g^2-2 f h\right )}{\sqrt{g^2-4 f h}}\right ) \log (c+d x)}{g+\sqrt{g^2-4 f h}+2 h x}\right ) \, dx}{f^2}+\frac{(b n) \int \frac{1}{x (a+b x)} \, dx}{f}-\frac{(d n) \int \frac{1}{x (c+d x)} \, dx}{f}+\frac{(b g n) \int \frac{\log \left (-\frac{b x}{a}\right )}{a+b x} \, dx}{f^2}-\frac{(d g n) \int \frac{\log \left (-\frac{d x}{c}\right )}{c+d x} \, dx}{f^2}-\frac{\left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \int \frac{g^2-f h+g h x}{f+g x+h x^2} \, dx}{f^2}\\ &=-\frac{n \log (a+b x)}{f x}-\frac{g n \log \left (-\frac{b x}{a}\right ) \log (a+b x)}{f^2}+\frac{n \log (c+d x)}{f x}+\frac{g n \log \left (-\frac{d x}{c}\right ) \log (c+d x)}{f^2}+\frac{n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)}{f x}+\frac{g \log (x) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{f^2}-\frac{g n \text{Li}_2\left (1+\frac{b x}{a}\right )}{f^2}+\frac{g n \text{Li}_2\left (1+\frac{d x}{c}\right )}{f^2}+\frac{(b n) \int \frac{1}{x} \, dx}{a f}-\frac{\left (b^2 n\right ) \int \frac{1}{a+b x} \, dx}{a f}-\frac{(d n) \int \frac{1}{x} \, dx}{c f}+\frac{\left (d^2 n\right ) \int \frac{1}{c+d x} \, dx}{c f}+\frac{\left (h \left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \int \frac{\log (a+b x)}{g+\sqrt{g^2-4 f h}+2 h x} \, dx}{f^2}-\frac{\left (h \left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \int \frac{\log (c+d x)}{g+\sqrt{g^2-4 f h}+2 h x} \, dx}{f^2}+\frac{\left (h \left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \int \frac{\log (a+b x)}{g-\sqrt{g^2-4 f h}+2 h x} \, dx}{f^2}-\frac{\left (h \left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \int \frac{\log (c+d x)}{g-\sqrt{g^2-4 f h}+2 h x} \, dx}{f^2}-\frac{\left (g \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )\right ) \int \frac{g+2 h x}{f+g x+h x^2} \, dx}{2 f^2}-\frac{\left (\left (g^2-2 f h\right ) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )\right ) \int \frac{1}{f+g x+h x^2} \, dx}{2 f^2}\\ &=\frac{b n \log (x)}{a f}-\frac{d n \log (x)}{c f}-\frac{b n \log (a+b x)}{a f}-\frac{n \log (a+b x)}{f x}-\frac{g n \log \left (-\frac{b x}{a}\right ) \log (a+b x)}{f^2}+\frac{d n \log (c+d x)}{c f}+\frac{n \log (c+d x)}{f x}+\frac{g n \log \left (-\frac{d x}{c}\right ) \log (c+d x)}{f^2}+\frac{n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)}{f x}+\frac{g \log (x) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{f^2}+\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (a+b x) \log \left (-\frac{b \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}-\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (c+d x) \log \left (-\frac{d \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}+\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (a+b x) \log \left (-\frac{b \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}-\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (c+d x) \log \left (-\frac{d \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}-\frac{g \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \log \left (f+g x+h x^2\right )}{2 f^2}-\frac{g n \text{Li}_2\left (1+\frac{b x}{a}\right )}{f^2}+\frac{g n \text{Li}_2\left (1+\frac{d x}{c}\right )}{f^2}-\frac{\left (b \left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \int \frac{\log \left (\frac{b \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{-2 a h+b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{a+b x} \, dx}{2 f^2}+\frac{\left (d \left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \int \frac{\log \left (\frac{d \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{-2 c h+d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{c+d x} \, dx}{2 f^2}-\frac{\left (b \left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \int \frac{\log \left (\frac{b \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{-2 a h+b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{a+b x} \, dx}{2 f^2}+\frac{\left (d \left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \int \frac{\log \left (\frac{d \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{-2 c h+d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{c+d x} \, dx}{2 f^2}+\frac{\left (\left (g^2-2 f h\right ) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )\right ) \operatorname{Subst}\left (\int \frac{1}{g^2-4 f h-x^2} \, dx,x,g+2 h x\right )}{f^2}\\ &=\frac{b n \log (x)}{a f}-\frac{d n \log (x)}{c f}-\frac{b n \log (a+b x)}{a f}-\frac{n \log (a+b x)}{f x}-\frac{g n \log \left (-\frac{b x}{a}\right ) \log (a+b x)}{f^2}+\frac{d n \log (c+d x)}{c f}+\frac{n \log (c+d x)}{f x}+\frac{g n \log \left (-\frac{d x}{c}\right ) \log (c+d x)}{f^2}+\frac{n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)}{f x}+\frac{\left (g^2-2 f h\right ) \tanh ^{-1}\left (\frac{g+2 h x}{\sqrt{g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{f^2 \sqrt{g^2-4 f h}}+\frac{g \log (x) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{f^2}+\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (a+b x) \log \left (-\frac{b \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}-\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (c+d x) \log \left (-\frac{d \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}+\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (a+b x) \log \left (-\frac{b \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}-\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (c+d x) \log \left (-\frac{d \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}-\frac{g \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \log \left (f+g x+h x^2\right )}{2 f^2}-\frac{g n \text{Li}_2\left (1+\frac{b x}{a}\right )}{f^2}+\frac{g n \text{Li}_2\left (1+\frac{d x}{c}\right )}{f^2}-\frac{\left (\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{2 h x}{-2 a h+b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{x} \, dx,x,a+b x\right )}{2 f^2}+\frac{\left (\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{2 h x}{-2 c h+d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{x} \, dx,x,c+d x\right )}{2 f^2}-\frac{\left (\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{2 h x}{-2 a h+b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{x} \, dx,x,a+b x\right )}{2 f^2}+\frac{\left (\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n\right ) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{2 h x}{-2 c h+d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{x} \, dx,x,c+d x\right )}{2 f^2}\\ &=\frac{b n \log (x)}{a f}-\frac{d n \log (x)}{c f}-\frac{b n \log (a+b x)}{a f}-\frac{n \log (a+b x)}{f x}-\frac{g n \log \left (-\frac{b x}{a}\right ) \log (a+b x)}{f^2}+\frac{d n \log (c+d x)}{c f}+\frac{n \log (c+d x)}{f x}+\frac{g n \log \left (-\frac{d x}{c}\right ) \log (c+d x)}{f^2}+\frac{n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)}{f x}+\frac{\left (g^2-2 f h\right ) \tanh ^{-1}\left (\frac{g+2 h x}{\sqrt{g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{f^2 \sqrt{g^2-4 f h}}+\frac{g \log (x) \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{f^2}+\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (a+b x) \log \left (-\frac{b \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}-\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (c+d x) \log \left (-\frac{d \left (g-\sqrt{g^2-4 f h}+2 h x\right )}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}+\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (a+b x) \log \left (-\frac{b \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}-\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \log (c+d x) \log \left (-\frac{d \left (g+\sqrt{g^2-4 f h}+2 h x\right )}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}-\frac{g \left (n \log (a+b x)-\log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \log \left (f+g x+h x^2\right )}{2 f^2}+\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{Li}_2\left (\frac{2 h (a+b x)}{2 a h-b \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}+\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{Li}_2\left (\frac{2 h (a+b x)}{2 a h-b \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}-\frac{g n \text{Li}_2\left (1+\frac{b x}{a}\right )}{f^2}-\frac{\left (g+\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{Li}_2\left (\frac{2 h (c+d x)}{2 c h-d \left (g-\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}-\frac{\left (g-\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}\right ) n \text{Li}_2\left (\frac{2 h (c+d x)}{2 c h-d \left (g+\sqrt{g^2-4 f h}\right )}\right )}{2 f^2}+\frac{g n \text{Li}_2\left (1+\frac{d x}{c}\right )}{f^2}\\ \end{align*}

Mathematica [A]  time = 0.8248, size = 721, normalized size = 0.72 \[ \frac{-\frac{n \left (g \sqrt{g^2-4 f h}-2 f h+g^2\right ) \left (\text{PolyLog}\left (2,\frac{b \left (\sqrt{g^2-4 f h}-g-2 h x\right )}{2 a h+b \sqrt{g^2-4 f h}+b (-g)}\right )-\text{PolyLog}\left (2,\frac{d \left (\sqrt{g^2-4 f h}-g-2 h x\right )}{2 c h+d \left (\sqrt{g^2-4 f h}-g\right )}\right )+\log \left (-\sqrt{g^2-4 f h}+g+2 h x\right ) \left (\log \left (\frac{2 h (a+b x)}{2 a h+b \sqrt{g^2-4 f h}+b (-g)}\right )-\log \left (\frac{2 h (c+d x)}{2 c h+d \sqrt{g^2-4 f h}+d (-g)}\right )\right )\right )}{\sqrt{g^2-4 f h}}+\frac{n \left (-g \sqrt{g^2-4 f h}-2 f h+g^2\right ) \left (\text{PolyLog}\left (2,\frac{b \left (\sqrt{g^2-4 f h}+g+2 h x\right )}{b \left (\sqrt{g^2-4 f h}+g\right )-2 a h}\right )-\text{PolyLog}\left (2,\frac{d \left (\sqrt{g^2-4 f h}+g+2 h x\right )}{d \left (\sqrt{g^2-4 f h}+g\right )-2 c h}\right )+\log \left (\sqrt{g^2-4 f h}+g+2 h x\right ) \left (\log \left (\frac{2 h (a+b x)}{2 a h-b \left (\sqrt{g^2-4 f h}+g\right )}\right )-\log \left (\frac{2 h (c+d x)}{2 c h-d \left (\sqrt{g^2-4 f h}+g\right )}\right )\right )\right )}{\sqrt{g^2-4 f h}}+2 g n \left (\text{PolyLog}\left (2,-\frac{b x}{a}\right )-\text{PolyLog}\left (2,-\frac{d x}{c}\right )+\log (x) \left (\log \left (\frac{b x}{a}+1\right )-\log \left (\frac{d x}{c}+1\right )\right )\right )+\left (\frac{g^2-2 f h}{\sqrt{g^2-4 f h}}+g\right ) \log \left (-\sqrt{g^2-4 f h}+g+2 h x\right ) \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )+\left (\frac{2 f h-g^2}{\sqrt{g^2-4 f h}}+g\right ) \log \left (\sqrt{g^2-4 f h}+g+2 h x\right ) \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )-\frac{2 f \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )}{x}-2 g \log (x) \log \left (e \left (\frac{a+b x}{c+d x}\right )^n\right )+\frac{2 f n (\log (x) (b c-a d)-b c \log (a+b x)+a d \log (c+d x))}{a c}}{2 f^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Log[e*((a + b*x)/(c + d*x))^n]/(x^2*(f + g*x + h*x^2)),x]

[Out]

((-2*f*Log[e*((a + b*x)/(c + d*x))^n])/x - 2*g*Log[x]*Log[e*((a + b*x)/(c + d*x))^n] + (2*f*n*((b*c - a*d)*Log
[x] - b*c*Log[a + b*x] + a*d*Log[c + d*x]))/(a*c) + (g + (g^2 - 2*f*h)/Sqrt[g^2 - 4*f*h])*Log[e*((a + b*x)/(c
+ d*x))^n]*Log[g - Sqrt[g^2 - 4*f*h] + 2*h*x] + (g + (-g^2 + 2*f*h)/Sqrt[g^2 - 4*f*h])*Log[e*((a + b*x)/(c + d
*x))^n]*Log[g + Sqrt[g^2 - 4*f*h] + 2*h*x] + 2*g*n*(Log[x]*(Log[1 + (b*x)/a] - Log[1 + (d*x)/c]) + PolyLog[2,
-((b*x)/a)] - PolyLog[2, -((d*x)/c)]) - ((g^2 - 2*f*h + g*Sqrt[g^2 - 4*f*h])*n*((Log[(2*h*(a + b*x))/(-(b*g) +
 2*a*h + b*Sqrt[g^2 - 4*f*h])] - Log[(2*h*(c + d*x))/(-(d*g) + 2*c*h + d*Sqrt[g^2 - 4*f*h])])*Log[g - Sqrt[g^2
 - 4*f*h] + 2*h*x] + PolyLog[2, (b*(-g + Sqrt[g^2 - 4*f*h] - 2*h*x))/(-(b*g) + 2*a*h + b*Sqrt[g^2 - 4*f*h])] -
 PolyLog[2, (d*(-g + Sqrt[g^2 - 4*f*h] - 2*h*x))/(2*c*h + d*(-g + Sqrt[g^2 - 4*f*h]))]))/Sqrt[g^2 - 4*f*h] + (
(g^2 - 2*f*h - g*Sqrt[g^2 - 4*f*h])*n*((Log[(2*h*(a + b*x))/(2*a*h - b*(g + Sqrt[g^2 - 4*f*h]))] - Log[(2*h*(c
 + d*x))/(2*c*h - d*(g + Sqrt[g^2 - 4*f*h]))])*Log[g + Sqrt[g^2 - 4*f*h] + 2*h*x] + PolyLog[2, (b*(g + Sqrt[g^
2 - 4*f*h] + 2*h*x))/(-2*a*h + b*(g + Sqrt[g^2 - 4*f*h]))] - PolyLog[2, (d*(g + Sqrt[g^2 - 4*f*h] + 2*h*x))/(-
2*c*h + d*(g + Sqrt[g^2 - 4*f*h]))]))/Sqrt[g^2 - 4*f*h])/(2*f^2)

________________________________________________________________________________________

Maple [F]  time = 1.398, size = 0, normalized size = 0. \begin{align*} \int{\frac{1}{{x}^{2} \left ( h{x}^{2}+gx+f \right ) }\ln \left ( e \left ({\frac{bx+a}{dx+c}} \right ) ^{n} \right ) }\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(ln(e*((b*x+a)/(d*x+c))^n)/x^2/(h*x^2+g*x+f),x)

[Out]

int(ln(e*((b*x+a)/(d*x+c))^n)/x^2/(h*x^2+g*x+f),x)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(e*((b*x+a)/(d*x+c))^n)/x^2/(h*x^2+g*x+f),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{\log \left (e \left (\frac{b x + a}{d x + c}\right )^{n}\right )}{h x^{4} + g x^{3} + f x^{2}}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(e*((b*x+a)/(d*x+c))^n)/x^2/(h*x^2+g*x+f),x, algorithm="fricas")

[Out]

integral(log(e*((b*x + a)/(d*x + c))^n)/(h*x^4 + g*x^3 + f*x^2), x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(ln(e*((b*x+a)/(d*x+c))**n)/x**2/(h*x**2+g*x+f),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\log \left (e \left (\frac{b x + a}{d x + c}\right )^{n}\right )}{{\left (h x^{2} + g x + f\right )} x^{2}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(e*((b*x+a)/(d*x+c))^n)/x^2/(h*x^2+g*x+f),x, algorithm="giac")

[Out]

integrate(log(e*((b*x + a)/(d*x + c))^n)/((h*x^2 + g*x + f)*x^2), x)